//
//  TTItem.m
//  Tint
//
//  Created by Kevin Wu on 2/22/12.
//  Copyright (c) 2012 Telligenty. All rights reserved.
//

#import "TTItem.h"
#import "TTCore.h"


@implementation TTItem


#pragma mark - Accessors

@synthesize title = _title;
@synthesize image = _image;
@synthesize userInfo = _userInfo;



#pragma mark - Memory

- (void)dealloc {
    TTRelease(_title);
    TTRelease(_image);
    TTRelease(_userInfo);
    [super dealloc];
}



#pragma mark - Public

+ (TTItem *)itemWithTitle:(NSString *)title {
    return [self itemWithTitle:title image:nil userInfo:nil];
}

+ (TTItem *)itemWithTitle:(NSString *)title userInfo:(id)userInfo {
    return [self itemWithTitle:title image:nil userInfo:userInfo];
}


+ (TTItem *)itemWithImage:(UIImage *)image {
    return [self itemWithTitle:nil image:image userInfo:nil];
}

+ (TTItem *)itemWithImage:(UIImage *)image userInfo:(id)userInfo {
    return [self itemWithTitle:nil image:image userInfo:userInfo];
}


+ (TTItem *)itemWithTitle:(NSString *)title image:(UIImage *)image {
    return [self itemWithTitle:title image:image userInfo:nil];
}

+ (TTItem *)itemWithTitle:(NSString *)title image:(UIImage *)image userInfo:(id)userInfo {
    TTItem *item = [[self alloc] init];
    item.title = title;
    item.image = image;
    item.userInfo = userInfo;
    return [item autorelease];
}

@end
